﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MN.Framework.Common.Security
{
    public enum PasswordType
    {
        Normal,
        MD5
    }
    public interface IMembership
    {
        PasswordType PasswordEncryptType { get; }
        bool validateUser(string Username, string password);
        IUser getUser(string UserName);
        IUser getCurrentUser();
        IUser[] getUsersByRole(string RoleName);
        IUser[] getUsersByRole(IRole Role);
        IRole getRole(string RoleName);
        IRole[] getUserRoles(string UserName);
        IRole[] getUserRoles(IUser User);

        IUser createUser(string UserName, string Password);
        IUser createUser(string UserName, string Password, IRole Role);
        bool deleteUser(string UserName);
    }
}
